/**
 * 
 */
package com.gragra.evaluateNouns;
import com.gragra.data.Corpus;
import com.gragra.nounIdentification.CountIdentifier;
import com.gragra.nounIdentification.NounIdentifier;
import com.gragra.parseOptions.CommandLineException;
import com.gragra.parseOptions.ListOfIntegerOption;
import com.gragra.parseOptions.Parser;
import com.gragra.sampling.sequentialStructure.WordAndTagHolder;
/**
 * @author Christoph Teichmann
 * created Jun 8, 2013 7:23:01 PM
 * @version 0.1
 */
public class EvaluateNounsCounting extends EvaluateNounsWithMapping
{
	/**
	 * 
	 */
	private int upTo = 1;
	/**
	 * 
	 */
	private static String upToOption = "upTo";
	/* (non-Javadoc)
	 * @see com.gragra.evaluateNouns.EvaluateNounsWithMapping#createIdentifier(com.gragra.data.Corpus)
	 */
	@Override
	protected NounIdentifier createIdentifier(Corpus<WordAndTagHolder> corp)
	{return new CountIdentifier(corp, getFrameSize(), getPreMarker(), getPostMarker(), getScore(), getCa(), getMa(), upTo);}
	/* (non-Javadoc)
	 * @see com.gragra.evaluateNouns.EvaluateNounsWithMapping#setOptions(com.gragra.parseOptions.Parser)
	 */
	@Override
	protected void setOptions(Parser cl)
	{
		ListOfIntegerOption lio = (ListOfIntegerOption) cl.getInformation(upToOption);
		if(lio.hasBeenSet())
		{this.upTo = lio.getSettings()[0];}
		super.setOptions(cl);
	}

	/* (non-Javadoc)
	 * @see com.gragra.evaluateNouns.EvaluateNounsWithMapping#addOptions(com.gragra.parseOptions.Parser)
	 */
	@Override
	public void addOptions(Parser to) throws CommandLineException
	{
		to.addOption(upToOption, new ListOfIntegerOption("this options sets the number of tags used"));
		super.addOptions(to);
	}

	/* (non-Javadoc)
	 * @see com.gragra.evaluateNouns.EvaluateNounsWithMapping#addNoRelevantOptions(com.gragra.parseOptions.Parser)
	 */
	@Override
	public void addNoRelevantOptions(Parser to) throws CommandLineException
	{
		to.addOption(upToOption, new ListOfIntegerOption("this options sets the number of tags used"));
		super.addNoRelevantOptions(to);
	}
}